package com.rabbit.order.service;

import com.rabbit.order.repository.OrderRepository;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

@Component
public class OrderDleMessage {
    @Autowired
    OrderRepository orderRepository;
    @RabbitListener(queues = "q.order.dle")
    public void service(String message){
        System.out.println(message);
        String[] split = message.split(":");
        String userId = split[0];
        String orderId = split[1];

        orderRepository.updateOrderError(orderId,userId );
    }
}
